package com.wnhz.wnmap.smovie.movie.controller;

import com.wnhz.wnmap.common.result.HttpResp;
import com.wnhz.wnmap.smovie.movie.service.IMovieService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "电影模块接口")
@RestController
@RequestMapping("/api/movie")
@Slf4j
public class MovieController {

    @Autowired
    private IMovieService  ims;


    @ApiOperation(value = "findAllMovie", tags = "查询所有电影")
    @GetMapping("/findByMovie")
    public HttpResp findByMovie(int currentPage, int size) {
        return HttpResp.success(ims.findByMovie(currentPage-1,size));
    }


    @ApiOperation(value = "findByName", tags = "根据输入的电影名称模糊查询")
    @GetMapping("/findByName")
    public HttpResp findByName(String name){
        return HttpResp.success(ims.findByNameLike(name));
    }
}
